import ajax from "../utils/request";

// 获取购物车的数据
export function getCart(data: {userid: string}){
  return ajax({
    url: '/cart/list',
    data,
    method: 'post'
  })
}

// 添加购物车
export function setCart(data: {userid: string,proid: string,num: number}){
  return ajax({
    url: '/cart/add',
    data,
    method: 'post'
  })
}

// 更新购物车数量的接口
export function updateNum(data: {cartid: string,num: number}){
  return ajax({
    url: '/cart/updatenum',
    data,
    method: 'post'
  })
}
